// import Cookie from 'js-cookie'
import { useRoute } from 'vue-router'
import { SubCategory } from '@/api/http'
// const route = useRoute
// console.log(route.params.id)
export default {
    state: {
     subCategoryList:[]
       

    },
    mutations: {
        updataSubCategory(state, val) {
            state.subCategoryList = val
            console.log(' state.subCategoryList',state.subCategoryList)

        },
       
    },
    actions: {
        async getSubCategoryList(store,{id}) {
            const { data: res } = await SubCategory(id)
            console.log('二级分类',res.result)
            store.commit('updataSubCategory', res.result)
            console.log('subCategoryList', store.state.subCategoryList)
        },
       

      

    }
}

